//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_PARTTAB_H__
#define __ELASTOS_PARTTAB_H__

enum PartitionType
{
    PartitionType_Empty             = 0x00,

    PartitionType_FAT12Primary      = 0x01,
    PartitionType_FAT16Primary      = 0x04,
    PartitionType_Extended          = 0x05,
    PartitionType_BIGDOSFATPrimary  = 0x06,
    PartitionType_NTFSPrimary       = 0x07,

    PartitionType_FAT32Primary      = 0x0b,
    PartitionType_FAT32Primary2     = 0x0c,
    PartitionType_FAT16Primary2     = 0x0e,
    PartitionType_Extended2         = 0x0f,
};

struct Partition
{
    uint8_t     u8BootIndicator;

    uint8_t     u8StartingHead;
    uint16_t    u16StartingSectorAndCylinder;

    uint8_t     u8SystemId;

    uint8_t     u8EndingHead;
    uint16_t    u16EndingSectorAndCylinder;

    uint16_t    u16RelativeSectorLow;
    uint16_t    u16RelativeSectorHigh;
    uint16_t    u16TotalSectorsLow;
    uint16_t    u16TotalSectorsHigh;
};

#define EXECUTABLE_MARKER           0xaa55

const uint_t c_uNumberOfPartTabEntries = 4;

struct PartitionTableSector
{
    uint8_t     u8Reserved[0x1BE];
    Partition   parttab[c_uNumberOfPartTabEntries];
    uint16_t    u16ExecutableMarker;
};

#endif //__ELASTOS_PARTTAB_H__
